﻿Imports System.IO

Public Class IOTummo
    Public LanguagePath As String

    Dim oFile As System.IO.File ' Read text file
    Dim oDir As System.IO.Directory
    Dim oRead As System.IO.StreamReader ' --		
    Dim sCurrentDir, sDir As String

    Public Function LanguageFileExits() As Boolean
        sCurrentDir = CurDir() & "\lang\lang-default.ini"
        If oFile.Exists(sCurrentDir) = True Then ' Kiem tra file co ton tai
            LanguageFileExits = True
            LanguagePath = sCurrentDir
        Else
            LanguageFileExits = False
        End If
    End Function

    Public Sub CheckFolder()
        Dim TummoFolder(4) As String

        TummoFolder(0) = "data"
        TummoFolder(1) = "dic"
        TummoFolder(2) = "img"
        TummoFolder(3) = "lang"

        For i = 0 To UBound(TummoFolder)
            sDir = CurDir() & "\" & TummoFolder(i)
            If oDir.Exists(sDir) = False Then
                oDir.CreateDirectory(sDir)
            End If
        Next

    End Sub
End Class
